package com.sgai.dcac.ui.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;

import com.sgai.dcac.R;
import com.sgai.dcac.ui.common.BaseActivity;
import com.sgai.dcac.utils.SharedPreferencesUtil;

public class MainActivity extends BaseActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (SharedPreferencesUtil.getLoginState()) {
            setContentView(getContentView());
            findViewById();
            setUpView();
            MenuActivity.startThisActivity(this);
        } else {
            //loginView
            LoginActivity.startThisActivity(MainActivity.this);
        }

    }

    @Override
    protected void findViewById() {

    }

    @Override
    protected void setUpView() {

    }

    @Override
    protected int getContentView() {
        return R.layout.activity_main;
    }

    public static void startThisActivity (Activity activity) {
        activity.startActivity(new Intent(activity,MainActivity.class));
    }
}
